package com.yckj.day03;

import java.util.Scanner;

/**
 * TODO 循环输入某同学结业考试的5门课成绩，并计算平均分
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/18 14:09
 */
public class Task3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入学生姓名:");
        String name = scan.next();
        double sum = 0.0;
        for (int i = 0; i < 5; i++) {
            System.out.print("请输入第"+(i+1)+"门成绩：");
            double score = scan.nextDouble();
            sum += score;
        }
        double avg = sum/5;
        System.out.println(name+"的平均成绩为： " + avg);
        scan.close();


    }
}
